<!doctype html>
<html>

<head>
	<include file="Base:static" />
	<block name="style">
	</block>
	<block name="script">
	</block>
	<script>
		var not_message_template = '<span style="width:100%; height:60px; line-height:60px; text-align:center; display:block">暂无信息</span>';
		var data_load_template = '<span style="width:100%; height:60px; line-height:180%; margin:20px 0px; text-align:center; display:block"><img src="__PUBLIC__/seller/img/loading.gif"/><br>正在加载</span>';
	</script>
</head>

<body data-type="login">
<header class="am-topbar am-topbar-inverse admin-header">
	<div class="am-topbar-brand">
		<a href="javascript:;" class="tpl-logo">
			<img src="__PUBLIC__/seller/img/logo.png" alt="">
		</a>
	</div>
	<div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right">

	</div>

	<button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

	<div class="am-collapse am-topbar-collapse" id="topbar-collapse">

		<ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
			<li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
				<a class="am-dropdown-toggle tpl-header-list-link" id="system_prompt_click" href="javascript:;">
					<span class="am-icon-bell-o"></span> 提醒 <span class="am-badge tpl-badge-success am-round" id="prompt_total_info"><neq name="message_info.prompt" value="0">{$message_info.prompt}<else/>0</neq></span></span>
				</a>
				<ul class="am-dropdown-content tpl-dropdown-content"></ul>
			</li>
			<li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
				<a class="am-dropdown-toggle tpl-header-list-link" id="system_message_click" href="javascript:;">
					<span class="am-icon-comment-o"></span> 系统消息 <span class="am-badge tpl-badge-danger am-round" id="message_total_info"><neq name="message_info.message" value="0">{$message_info.message}<else/>0</neq></span></span>
				</a>
				<ul class="am-dropdown-content tpl-dropdown-content"></ul>
			</li>
			<li class="am-hide-sm-only"><a href="javascript:;" id="admin-fullscreen" class="tpl-header-list-link"><span class="am-icon-arrows-alt"></span> <span class="admin-fullText">开启全屏</span></a></li>

			<li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
				<a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
					<span class="tpl-header-list-user-nick">{$login_info.contact}</span><span class="tpl-header-list-user-ico"> <img src="__PUBLIC__/seller/img/user01.png"></span>
				</a>
				<ul class="am-dropdown-content">
					<li><a href="{:U('Index/saveInfo')}" title="商家资料修改" width="600" height="400" menu="load_iframe_url"><span class="am-icon-bell-o"></span> 资料</a></li>
					<li><a href="{:U('Index/savePass')}" title="密码修改" width="600" height="330" menu="load_iframe_url"><span class="am-icon-cog"></span> 密码修改</a></li>
					<li><a href="javascript:;" id="out_login"><span class="am-icon-power-off"></span> 退出</a></li>
				</ul>
			</li>
			<li><a href="javascript:;" id="out_login_2" class="tpl-header-list-link"><span class="am-icon-sign-out tpl-header-list-ico-out-size"></span></a></li>
		</ul>
	</div>
</header>
<div class="tpl-page-container tpl-page-header-fixed">


	<div class="tpl-left-nav tpl-left-nav-hover">
		<div class="tpl-left-nav-title">
			功能菜单
		</div>
		<div class="tpl-left-nav-list">
			<ul class="tpl-left-nav-menu">
				<li class="tpl-left-nav-item">
					<a href="{:U('Index/index')}" class="nav-link active">
						<i class="am-icon-home"></i>
						<span>首页</span>
					</a>
				</li>
                                
                                <li class="tpl-left-nav-item">
					<a href="javascript:;" class="nav-link tpl-left-nav-link-list menu_list_frist">
						<i class="am-icon-wpforms"></i>
						<span>商品管理</span>
						<i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
					</a>
					<ul class="tpl-left-nav-sub-menu" style="display:block">
						<li>
							<a href="{:U('Goods/index')}">
								<i class="am-icon-angle-right"></i>
								<span>商品共享库</span>
							</a>
							<a href="{:U('Goods/supplyGoodsList')}">
								<i class="am-icon-angle-right"></i>
								<span>供货清单</span>
							</a>
							<a href="{:U('Goods/distribution',array('type' => 'distribution'))}">
								<i class="am-icon-angle-right"></i>
								<span>分销清单</span>
							</a>
						</li>
                        <li>
						     <a href="{:U('Goods/distribution',array('type' => 'lock'))}">
								<i class="am-icon-angle-right"></i>
								<span>锁库清单</span>
							</a>
						</li>  
					</ul>
				</li>
                <li class="tpl-left-nav-item">
					<a href="javascript:;" class="nav-link tpl-left-nav-link-list menu_list_frist">
						<i class="am-icon-wpforms"></i>
						<span>商品订单管理</span>
						<i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
					</a>
					<ul class="tpl-left-nav-sub-menu" style="display:block">
                         <li>
                                <a href="{:U('Order/supplyList')}">
								<i class="am-icon-angle-right"></i>
								<span>供货列表</span>
							</a>
						</li>
                        <li>
						     <a href="{:U('Order/distributionList')}">
								<i class="am-icon-angle-right"></i>
								<span>分销列表</span>
							</a>
						</li>                
					</ul>
				</li>
                <li class="tpl-left-nav-item">
					<a href="javascript:;" class="nav-link tpl-left-nav-link-list menu_list_frist">
						<i class="am-icon-wpforms"></i>
						<span>锁库订单管理</span>
						<i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right"></i>
					</a>
					<ul class="tpl-left-nav-sub-menu">
                         <li>
                                <a href="{:U('LockOrder/lists')}">
								<i class="am-icon-angle-right"></i>
								<span>订单列表</span>
							</a>
						</li>                     
					</ul>
				</li>
				<li class="tpl-left-nav-item">
					<a href="javascript:;" class="nav-link tpl-left-nav-link-list menu_list_frist">
						<i class="am-icon-wpforms"></i>
						<span>账户管理</span>
						<i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right"></i>
					</a>
					<ul class="tpl-left-nav-sub-menu">
						<li>
							<a href="{:U('Accunt/info')}">
								<i class="am-icon-angle-right"></i>
								<span>基本资料</span>
							</a>
							<a href="{:U('Setting/index')}">
								<i class="am-icon-angle-right"></i>
								<span>系统基本设置</span>
							</a>
							<a href="{:U('Accunt/local')}">
								<i class="am-icon-angle-right"></i>
								<span>我的钱包</span>
							</a>
                                                        <a href="{:U('Address/lists')}">
								<i class="am-icon-angle-right"></i>
								<span>收货地址</span>
							</a>
                                                        <a href="{:U('Dispatching/index')}">
								<i class="am-icon-angle-right"></i>
								<span>配送模板</span>
							</a>
							<a href="{:U('Accunt/security')}">
								<i class="am-icon-angle-right"></i>
								<span>API安全</span>
							</a>
							
							<a href="{:U('Accunt/platformBind')}">
								<i class="am-icon-angle-right"></i>
								<span>第三方平台绑定</span>
							</a>
                            
                            <a href="{:U('Warehouse/lists')}">
								<i class="am-icon-angle-right"></i>
								<span>仓库管理</span>
							</a>
						</li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
	<block name="content">
	</block>
</div>
<script id="system_message_list_template">
	<li class="tpl-dropdown-content-external">
		<h3>你有 <span class="tpl-color-danger">{{ d.total }}</span> 条新消息</h3><a href="{:U('Index/systemMessageList')}">全部</a>
	</li>
	{{#  $.each(d.list, function(index, item){ }}
	<li>
		<a href="{{ item.url }}" data-value="{{ item.id }}" backfunc="saveSystemMessage" title="【{{ item.title }}】消息查看" width="600" height="400" menu="load_iframe_url" class="tpl-dropdown-content-message">
			<span class="tpl-dropdown-content-subject" style="margin-left:0;">
				<span class="tpl-dropdown-content-from">{{ item.title }}</span>
				<span class="tpl-dropdown-content-time">{{ item.time }}</span>
			</span>
			<span class="tpl-dropdown-content-font" style="margin-left:0;">{{ item.content }}</span>
		</a>
	</li>
	{{#  }); }} 
</script>
<script id="system_prompt_list_template">
	<li class="tpl-dropdown-content-external">
		<h3>你有 <span class="tpl-color-success">{{ d.total }}</span> 条提醒</h3><a href="###">全部</a></li>
	{{#  $.each(d.list, function(index, item){ }}
	<li class="tpl-dropdown-list-bdbc"><a href="javascript:;" data-id="{{ item.id }}" data-url="{{ item.url }}" id="prompt_href" class="tpl-dropdown-list-fl">{{ item.title }}</a>
		<span class="tpl-dropdown-list-fr">{{ item.time }}</span>
	</li>
	{{# }); }}
</script>
<script>
	var system_message_but = false;
	var system_prompt_but = false;
	$('#system_message_click').click(function(){
		if( system_message_but == false ) {
			var _self = $(this).parent().find( '.am-dropdown-content' );
			_self.html( data_load_template );
			$.get( '{:U('Index/systemMessageTips')}' , function(data){
				$('#message_total_info').text( data.total );
				if( data.total > 0 ) {
					laytpl($('#system_message_list_template').html() ).render(data , function(html){
						_self.html( html );
					});
					return;
				}
				_self.html( not_message_template );
			},'json');
			system_message_but = true;
		} else {
			system_message_but = false;
		}
	});
	$('#system_prompt_click').click(function(){
		if( system_prompt_but == false ) {
			var _self = $(this).parent().find( '.am-dropdown-content' );
			_self.html( data_load_template );
			$.get( '{:U('Index/systemPromptTips')}' , function(data){
				$('#prompt_total_info').text( data.total );
				if( data.total > 0 ) {
					laytpl($('#system_prompt_list_template').html() ).render(data , function(html){
						_self.html( html );
					});
					return;
				}
				_self.html( not_message_template );
			},'json');
			system_prompt_but = true;
		} else {
			system_prompt_but = false;
		}
	});
	
	//定时获得消息数量提示
	setInterval(function(){
		$.get('{:U('Index/getMessageTotal')}' , function(data){
			$('#message_total_info').text( data.message );
			$('#prompt_total_info').text( data.prompt );
		}, 'json');
	} , 30000);
	
	$('#out_login').click(function(){
		zeroModal.confirm("是否确认退出登录？", function() {
            location.href="{:U('Public/outLogin')}";
        });
	});
	$('#out_login_2').click(function(){
		zeroModal.confirm("是否确认退出登录？", function() {
            location.href="{:U('Public/outLogin')}";
        });
	});
	function saveSystemMessage( obj ) {
		var _self = $('#system_message_click').parent().find( '.am-dropdown-content' );
		_self.html( data_load_template );
		$.get( '{:U('Index/systemMessageTips')}' , { itemid : obj.attr('data-value') } , function(data){
			$('#message_total_info').text( data.total );
			if( data.total > 0 ) {
				laytpl($('#system_message_list_template').html() ).render(data , function(html){
					_self.html( html );
				});
				return;
			}
			_self.html( not_message_template );
		},'json');
	}
	
	$(document).on('click' , 'a#prompt_href',function(){
		var data_url = $(this).attr('data-url');
		$.get( '{:U('Index/systemPromptTips')}' , { itemid : $(this).attr('data-id')} , function(){
			location.href = data_url;
		} , 'json' );
	});
</script>
<script src="__PUBLIC__/seller/js/app.js"></script>
</body>
</html>